<template>
    <div class="cinemas" v-if="cinemas">
        <cinemaheader></cinemaheader>
        <cinemacontent :cinemas="cinemas"></cinemacontent>
    </div>
</template>

<script>
import axios from 'axios'
import Appfooter from '../../components/Appfooter.vue'
import Appheader from '../../components/Appheader.vue'
import Cinemaheader from './components/cinemaheader.vue'
import Cinemacontent from './components/cinemacontent.vue'


export default {

    data() {
        return {
            cinemas: []
        }
    },
    methods: {
        getcinemas() {
            axios.get(`https://m.maizuo.com/gateway?cityId=${this.$store.state.cityid}&ticketFlag=1&k=9002591`, {
                headers: {
                    'X-Host': 'mall.film-ticket.cinema.list'
                }
            })
                .then(res => res.data)
                .then(res => {
                    this.cinemas = res.data.cinemas
                })
        },
    },
    created() {
        this.getcinemas()
    },
    components: { Appheader, Appfooter, Cinemaheader, Cinemacontent }
}
</script>

<style lang="less" scoped></style>